package aip.project.controller.bio.Admin.DeleteCategoria;

import java.util.ArrayList;
import java.util.List;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;
import org.slim3.datastore.Datastore;

import aip.project.model.ListaCategorie;
import aip.project.service.ListaCategorieService;

public class IndexController extends Controller {

    ListaCategorieService cs = new ListaCategorieService();
    @Override
    public Navigation run() throws Exception {
        List<String[]> lc = new ArrayList<String[]>();
        for (ListaCategorie c: cs.getListaCategorie())
            lc.add(new String[] {c.getNome(),Datastore.keyToString(c.getKey())});
        requestScope("categorie",lc);
        return forward("index.jsp");
    }
}
